package org.stw.bullfrog.MVC.controller
{
	import org.stw.bullfrog.ui.core.BSprite;
	import org.stw.bullfrog.ui.managers.UIManager;
	
	public class Controller extends Object
	{
		private var _viewContainer:BSprite;
		
		public function Controller()
		{
			super();
			this.init();
		}
		
		public function init():void
		{
			this.viewContainer.displayedAction = this.viewDidAppear;
			this.viewContainer.disappearedAction = this.viewDidDisappear;
		}
		
		//life cycle		
		protected function viewDidAppear():void
		{
			
		}
		
		protected function viewDidDisappear():void
		{
			
		}
		
		//弹出窗口函数，指定弹出动画
		public function popView(view:BSprite, animation:int):void
		{
			//this.view.addChild(sprite);
			UIManager.getPopUpManager().addPopUp(view);
		}

		public function get viewContainer():BSprite
		{
			return _viewContainer;
		}

		public function set viewContainer(value:BSprite):void
		{
			_viewContainer = value;
		}
		
		

	}
}